package com.bwie.controller;

import com.bwie.common.domain.Customer;
import com.bwie.common.domain.Dict;
import com.bwie.common.domain.User;
import com.bwie.common.result.Result;
import com.bwie.service.DictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @className: DictController
 * @Description: TODO
 * @version: v1.８.0
 * @author: GONGWENXUE
 * @date: 2025/10/10 13:53
 */
@CrossOrigin
@RestController
@RequestMapping("dict")
public class DictController {
    @Autowired
    DictService dictService;
    /**
     * 商机类型下拉框
     */
    @PostMapping("typeDrop")
    public Result typeDrop(){
        List<Dict> typeDrop=dictService.typeDrop();
        return Result.success(typeDrop);
    }
    /**
     * 来源下拉框
     */
    @PostMapping("sourceDrop")
    public Result sourceDrop(){
        List<Dict> sourceDrop=dictService.sourceDrop();
        return Result.success(sourceDrop);
    }
    /**
     * 关联客户
     */
    @PostMapping("getUser")
    public Result UserDrop(){
        List<Customer> userDrop=dictService.UserDrop();
        return Result.success(userDrop);
    }
    /**
     * 销售阶段
     */
    @PostMapping("stageDrop")
    public Result stageDrop(){
        List<Dict> stageDrop=dictService.stageDrop();
        return Result.success(stageDrop);
    }
    /**
     * 成交几率
     */
    @PostMapping("rateDrop")
    public Result rateDrop(){
        List<Dict> rateDrop=dictService.rateDrop();
        return Result.success(rateDrop);
    }
    /**
     * 成交几率
     */
    @PostMapping("sysDrop")
    public Result sysDrop(){
        List<User> sysDrop=dictService.sysDrop();
        return Result.success(sysDrop);
    }
}